package com.ms.game.rebate;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.ms.game.lobby.GameLobbyModule;
import com.xpec.c4.message.MessageTypes;
import com.xpec.c4.service.annotations.MessageType;
import com.xpec.c4.service.common.BaseMessageAction;
import com.xpec.c4.service.contexts.Contexts;

public class RebateAction extends BaseMessageAction{
	@SuppressWarnings("unused")
	private static final Log log = LogFactory.getLog(RebateAction.class);
	
	
	@MessageType(typeCode = MessageTypes.C_GET_COMMISON_REBATE_REQUEST)
	public void getCommisonRebateCoin(Long time){
		//取得單筆抽佣回饋金
		GameLobbyModule module = (GameLobbyModule)Contexts.getModule();
		RebateProcessor.OnGetCommisonRebateCoin(sessionID, module, time);
	}
	
	@MessageType(typeCode = MessageTypes.C_GET_UPLINE_INVITE_REWARD_REQUEST)
	public void getUplineInviteReward(String downlineId) {
		//取得上線邀請獎勵
		GameLobbyModule module = (GameLobbyModule)Contexts.getModule();
		RebateProcessor.OnGetUplineInviteReward(sessionID, module, downlineId);
	}
	
	@MessageType(typeCode = MessageTypes.C_GET_MONTHLY_DAILY_AWARD_REBATE_REQUEST)
	public void getMonthlyDailyAwardRebateCoin(Object request){
		//取得包月每日講例回饋金
		GameLobbyModule module = (GameLobbyModule)Contexts.getModule();
		RebateProcessor.OnGetLoginMonthlyFeeDailyAward(sessionID, module);
	}

	@MessageType(typeCode = MessageTypes.C_GET_WEEKLY_DAILY_AWARD_REBATE_REQUEST)
	public void getWeeklyDailyAwardRebateCoin(Object request){
		//取得包月每日講例回饋金
		GameLobbyModule module = (GameLobbyModule)Contexts.getModule();
		//先寫死包週
		RebateProcessor.OnGetLoginBuyFeeDailyAward(sessionID, module, RebateType.WEEKLY_FEE_DAILY_PAY.getId());
	}
	
	@MessageType(typeCode = MessageTypes.C_CHECK_HAS_REBATE_REQUEST)
	public void checkHasRebateCoin(Object request){
		//檢查是否有可領的回饋金 (包月跟抽佣)
		GameLobbyModule module = (GameLobbyModule)Contexts.getModule();
		RebateProcessor.OnCheckHasRebates(sessionID, module);
	}

//	@MessageType(typeCode = MessageTypes.C_CHECK_HAS_WEEKLY_REBATE_REQUEST)
//	public void checkHasWeeklyRebateCoin(String bankBuyFeeType){
//		//檢查是否有可領的回饋金 (包月跟抽佣)
//		GameLobbyModule module = (GameLobbyModule)Contexts.getModule();
//		RebateProcessor.OnCheckHasWeeklyRebates(sessionID, module, bankBuyFeeType);
//	}
	
	@MessageType(typeCode = MessageTypes.C_GET_ALL_REBATE_REQUEST)
	public void getAllRebateCoins(Object request){
		//取得所有可領的回饋金
		GameLobbyModule module = (GameLobbyModule)Contexts.getModule();
		RebateProcessor.OnGetAllRebateCoins(sessionID, module);
	}
	

}
